package com.xiaoshuidi.cloud.module.bpm.enums.swo;


import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum TicketServiceProcessStatusEnum {

    PROCESS_STATUS_UNPROCESSED(0, "待处理"),

    PROCESS_STATUS_ONPROCESS(1, "处理中"),

    PROCESS_STATUS_PROCESSED(2, "已处理"),

    PROCESS_STATUS_NOTPROCESS(3, "不予处理");


    private final int processStatus;
    private final String desc;

    public static String getNameByStatus(int status) {
        TicketServiceProcessStatusEnum ticketServiceProcessStatusEnum = Arrays.stream(TicketServiceProcessStatusEnum.values()).filter(p -> p.getProcessStatus() == status ).findFirst().orElse(null);
        if (ObjectUtil.isEmpty(ticketServiceProcessStatusEnum)) {
            return "";
        }
        return ticketServiceProcessStatusEnum.getDesc();
    }

}
